var CompareDate = Class.create();

CompareDate.prototype = {
	initialize : function() {
	},

	createURL : function(table, array) {
		var url = gs.getProperty("glide.report.publish.url");
		// example url:
		// http://air-dev.asml.com/u_qm_issues_list.do?sysparm_query=sys_idIN89437483926ae16d0149421be101d6a1%2C5397eb1f75ef900046e21e4ef397643e
		return url + table + '_list.do?sysparm_query=sys_idIN' + array;

	},

	getPCCSTRAIM : function(x, y, z, q) {
		var array = [];
		var i = 0;
		var query = x + 'ISNOTEMPTY^' + z + 'ISNOTEMPTY';
		if (q == true) {
			query = query + '^active' + q;
		}
		gs.print(query);
		var gr = new GlideRecord('u_qm_issues');
		gr.addEncodedQuery(query);
		gr.query();
		while (gr.next()) {	

			eval('var d1 = gr.' + x + ';');
			eval('var d2 = gr.' + z + ';');
			eval('var check = ' + d1 + y + d2 + ';');

			if (check) {

				array.push(gr.sys_id.toString());
				i++;
			}

		}
		return array;
	}

};
